/**
  * Copyright (c) CSIRO Australia, 2009
  *
  * @author $Author: jia020 $
  * @version $Id: PDQuery.java 643 2009-05-20 00:20:55Z jia020 $
  */
package au.csiro.nt.pdsp.workflow;
import au.csiro.nt.pdsp.util.MySQL;
import java.sql.ResultSet;
import java.sql.SQLException;
/**
 * @author jia020
 *
 */
public class PDQuery {
	protected String sql;
	private String   m_dbJDBC="jdbc:mysql://127.0.0.1:3306/econtract?autoReconnect=true";
	private String   m_dbUser="root";
	private String   m_dbPin="Centie2nat";	
	public String query() {
		try {
    		MySQL mysql = new MySQL(m_dbUser, m_dbPin, m_dbJDBC);// config.getInstance().mysql2;//
		// check expired econtract
		sql = "select eContractID from econtractmanager where ExpireDate<now() and State<>'Expired'";
		ResultSet rsSearch = mysql.execSelect(sql);
		if (rsSearch == null)
			return "NULL";
		int cc = rsSearch.getRow();
		while (rsSearch.next()) {
			int nEContractID = rsSearch.getInt("eContractID");
			String message = "expired:" + nEContractID;
		}
		;
		rsSearch.close();
		} catch (SQLException ex) {
			
		}
		return "OK";
	}
}
